home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1986 November & December / rerun-1986-11-12.d64 / morse code 64 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  102 lines

  1. 100 data 112211,0,12,2111,2121,211,1,1121,221,1111,11,1222,212,1211,22,21,222
  2. 110 data 1221,2212,121,111,2,112,1112,122,2112,2122,2211,212212
  3. 120 data 12121,111212,1111111,221122,21112,121212,21121,22222
  4. 130 data 12222,11222,11122,11112,11111,21111,22111,22211,22221,222111,212121
  5. 140 data 162,6,32,255,233,232,224,25,208,248,96
  6. 150 al$="abcdefghijklmnopqrstuvwxyz1234567890?,./:;-(":d$(1)="[187]":d$(2)="[162][187]"
  7. 160 dimc(91,7),c$(91):cr$=""
  8. 170 b=63:e=90:gosub180:b=40:e=59:gosub180:goto200
  9. 180 fora=btoe:readl$:forc=1tolen(l$):c(a,c)=val(mid$(l$,c,1))
  10. 190 c$(a)=c$(a)+d$(c(a,c)):next:next:return
  11. 200 forad=828to838:readn:pokead,n:next
  12. 210 readlb$(q):iflb$(q)<>"x"thenq=q+1:goto210
  13. 220 poke54277,9:poke54278,144:poke54274,0:poke54275,8:poke54296,15
  14. 230 poke53280,6:poke53281,0:print"[147][151]                   [180][146][185][162]"
  15. 240 print"             [205][162][162] [190][190] [215]  [163] [146][185][163][146][192]"
  16. 250 print"          [223]                   "
  17. 260 print"[154]     [162][187][187][187][162][187][187][187][162][187][187][187][162][187][187][187][162][187][187][187][162][187][187][187][162][187][187][187][162][187][153]":m$="international morse code"
  18. 270 f$(0)="[151][215][146]":f$(1)="[209]"
  19. 280 s(1)=1:s(2)=3:tm=40:tt$=m$:ifflthenprinttab(8)m$:goto400
  20. 290 forl=1to24:gosub300:printcr$;"[145][153]";tab(7+l);ml$:next:fl=1:goto400
  21. 300 ml$=mid$(m$,l,1):s(0)=2:s=0:poke54272,74:poke54273,42
  22. 310 s=s+1:f=1:t=c(asc(ml$),s):iftthen340
  23. 320 f=0:ifml$=" "thens(0)=4
  24. 330 goto350
  25. 340 printf$(f):poke54276,65
  26. 350 fordur=1totm*s(t):next:poke54276,64:printf$(0)
  27. 360 forrs=1totm:next:iftthen310
  28. 370 return
  29. 400 printcr$;tab(17);"[158] menu ":printtab(14)"1. code chart"
  30. 410 printtab(14)"2. receiving":printtab(14)"3. sending"
  31. 420 geta$:ifa$<"1"ora$>"3"then420
  32. 430 onval(a$)goto440,650,900
  33. 440 t$="[147][153]        "+m$+"":printt$"":m$=al$:forl=65to77:n=0
  34. 450 ifl<75thenn=asc(mid$(m$,l-38,1))
  35. 460 print" ";chr$(l);" ";c$(l);tab(14);chr$(l+13);" ";c$(l+13);
  36. 470 printtab(27);chr$(n);" ";c$(n):next
  37. 480 poke214,22:print:print"  [159]<<<  1.next   2.review   3.menu  >>>"
  38. 490 geta$:ifa$<"1"ora$>"3"then490
  39. 500 onval(a$)goto550,510,230
  40. 510 f$(0)="                     ":tm=75:b=0:j=1:k=13:gosub530:b=13:k=26
  41. 520 gosub530:b=26:k=36:gosub530:goto490
  42. 530 forl=jtok:c=4:gosub540:gosub300:c=13:gosub540:b=b+40:next:j=j+13:return
  43. 540 forp=btob+11:poke55497+p,c:next:return
  44. 550 printt$:forl=37to40:a1=asc(mid$(al$,l,1)):a2=asc(mid$(al$,l+4,1))
  45. 560 printtab(5);chr$(a1);" ";c$(a1);tab(22);chr$(a2);" ";c$(a2):print:next
  46. 570 printtab(5)"wait (l)           "+c$(76)
  47. 580 printtab(5)"invite to xmit (k) "+c$(75)
  48. 590 printtab(5)"end of message     "+c$(41)
  49. 600 printtab(5)"end of work        "+c$(42)
  50. 610 printtab(5)"error              "+c$(43)
  51. 620 print"    [159]<<<  press any key for menu  >>>"
  52. 630 geta$:ifa$=""then630
  53. 640 goto230
  54. 650 sys828:printcr$;"[145][153]";tab(8);tt$
  55. 660 printtab(14);"[158] receive menu "
  56. 670 printtab(12)"1. rndm characters":printtab(12)"2. library message"
  57. 680 printtab(12)"3. input message":printtab(12)"4. main menu"
  58. 690 geta$:ifa$<"1"ora$>"4"then690
  59. 700 onval(a$)goto710,800,810,230
  60. 710 m$=al$:tm=75
  61. 720 sys828:poke198,0:l=int(rnd(.)*43+1):gosub300:printcr$;tab(20);"[158][166]"
  62. 730 geta$:ifa$=""then730
  63. 740 printcr$;tab(20);a$
  64. 750 c$=ml$+"  "+c$(asc(ml$)):printtab(20-len(c$)/2);"[153]";c$
  65. 760 poke214,21:print:printtab(7);"[159]<<<  continue or menu  >>>"
  66. 770 geta$:ifa$=""then770
  67. 780 ifa$="m"then650
  68. 790 goto720
  69. 800 l=int(rnd(.)*q):m$=lb$(l):goto820
  70. 810 sys828:printcr$:input" [153]message";m$
  71. 820 sys828:printcr$:input" [153]words per minute";t:tm=700/t
  72. 830 printtab(5)"[158]<<< press any key to begin >>>"
  73. 840 geta$:ifa$=""then840
  74. 850 sys828:forl=1tolen(m$):gosub300
  75. 860 printcr$;tab(l+1);:ifasc(ml$)>32thenprint"[157][158][218]"
  76. 870 next:sys828:printcr$;m$:poke214,20:print
  77. 880 print"    [159]<<<  press any key for menu  >>>"
  78. 890 geta$:ifa$=""then890
  79. 895 goto650
  80. 900 sys828:printcr$;tab(14);"begin sending":t=0
  81. 910 poke214,21:print:printtab(7);"[159]<<< press 'm' for menu >>>":rw$="":r=10
  82. 920 l=18:m$="":geta$:ifa$="m"then230
  83. 930 ifa$=""then920
  84. 940 printcr$;tab(14);"              ":ifti-d>30thent=t+1
  85. 950 d=ti:printf$(1):poke54276,65
  86. 960 ifpeek(197)<>64then960
  87. 970 poke54276,64:printf$(0):k=2:ifti-d<8thenk=1
  88. 980 printcr$;tab(l);"[158]";d$(k):l=l+k:m$=m$+d$(k):d=ti
  89. 990 geta$:ifa$<>""then950
  90. 1000 ifti-d<15then990
  91. 1010 forc=44to90:ifc$(c)<>m$thennext:c=42
  92. 1020 poke198,0:printcr$;rw$;tab(t);chr$(c):t=t+1:d=ti:ift<37then920
  93. 1030 t=1:rw$=rw$+"":r=r+1:ifr<20then920
  94. 1040 goto900
  95. 5000 data no one knows their limitations until they try
  96. 5010 data "everyone desires to live long, but no one desires to be old."
  97. 5020 data "like our shadows, our wishes lengthen as our sun sets"
  98. 5030 data it is best not to swap horses when crossing a stream
  99. 5040 data "all things that are, are with more spirit chased than enjoyed."
  100. 5050 data "experience is the best teacher, except that the tuition is costly."
  101. 5060 data x
  102.